<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/template.xhtml">
	
	<ui:define name="title">
		<h3><h:outputLabel	value="#{i18n['erp.matricula.nivel.paralelo.pagina.titulo']}" /></h3>
	</ui:define>	

	
	<ui:define name="content">
		<h:form id="formNivelParalelo">
		
			<p:growl id="pnlMessages" autoUpdate="true" closable="true"/>
			
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton id="btnRefrescar" value="Refrescar" icon="ui-icon-arrowrefresh-1-w" >
					</p:commandButton>
					<p:commandButton id="btnNuevoNivelParalelo" value="Insertar" icon="ui-icon ui-icon-circle-plus" oncomplete="dlgNuevoNivelParalelo.show()">
						</p:commandButton>
				</p:toolbarGroup>
			</p:toolbar>
			
			<p:panel id="pnlBuscar" header="#{i18n['erp.matricula.nivel.paralelo.buscar']}">
				<table class="formulario" id="tableStyleRe">
					<tr>
						<td class="label"><h:outputLabel value="#{i18n['erp.matricula.nivel.paralelo.nivel']}"  /> 
						<h:outputLabel value="#{i18n['label.signo.requerido']}"
								styleClass="item-required" />
						</td>
						<td class="value"><p:selectOneMenu id="nivel" value="#{nivelParaleloDataManager.nivelCodigo}" filter="true" style="width:250px">
								<f:selectItem itemLabel="#{i18n['label.seleccione']}"/>
								<f:selectItems value="#{nivelParaleloController.nivelParaleloDataManager.nivelList}" var="nivel" itemLabel="#{nivel.nivDescaripcion} " itemValue="#{nivel.nivCodigo}"/>
								<p:ajax listener="#{nivelParaleloController.buscarNivelParalelo}" process="@this" update="paralelo"/>
							</p:selectOneMenu>
						</td>
						<td>
						<p:commandButton id="btnBuscar"
					actionListener="#{nivelParaleloController.buscarNivelParalelo()}"
					value="#{i18n['label.buscar']}" 
					 icon="ui-icon-search"
					process="@this,pnlBuscar"
					update=":formNivelParalelo:pnlMessages,tablaNivelParalelo,pnlBuscar" />
						</td>
						
					</tr>
					
					<tr>
						<td class="label"><h:outputLabel value="#{i18n['erp.matricula.nivel.paralelo.paralelo']}"  />
						<h:outputLabel value="#{i18n['label.signo.requerido']}"
								styleClass="item-required" /> </td>
						<td class="value"><p:selectOneMenu style="width:250px"
						        id="paralelo" value="#{nivelParaleloDataManager.paraleloCodigo}" filter="true" >
								<f:selectItem itemLabel="#{i18n['label.seleccione']}"/>
								<f:selectItems value="#{nivelParaleloDataManager.nivelParaleloList}" var="nivelParalelo" itemLabel="#{nivelParalelo.matParalelo.parDescripcion}" itemValue="#{nivelParalelo.matParalelo.parCodigo}"/>
							</p:selectOneMenu>
						</td>
												
					</tr>
				</table>
			</p:panel>

			<p:panel id="botonesBuscar">
				
			</p:panel>


			<p:dataTable id="tablaNivelParalelo" rowIndexVar="rowIndex" paginator="true" rows="5" paginatorPosition="bottom"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="5,10,15" emptyMessage="#{i18n['erp.matricula.nivel.paralelo.lista']}" value="#{nivelParaleloDataManager.nivelParaleloList}" var="nivpar">
				
				<f:facet name="header">
					#{i18n['erp.matricula.nivel.paralelo.lista']}
				</f:facet>
				<p:column headerText="#" styleClass="centered" width="5%">
					#{rowIndex+1}
				</p:column>

				<p:column headerText="#{i18n['erp.matricula.nivel.paralelo.nivel']}" width="40%">
					<h:outputText value="#{nivpar.matNivel.nivDescaripcion}" />
				</p:column>								

				<p:column headerText="#{i18n['erp.matricula.nivel.paralelo.paralelo']}" width="35%">
						<h:outputText value="#{nivpar.matParalelo.parDescripcion}" />
				</p:column>
				<p:column headerText="#{i18n['label.opciones']}" styleClass="centered" width="10%">
					<h:panelGroup>
						<p:commandLink styleClass="no-decor"
							title="#{i18n['label.editar']}"
							>
							<h:graphicImage value="/resources/img/edit.png" alt="#{i18n['label.editar']}"/>
						</p:commandLink>
					</h:panelGroup>
				</p:column>	
							

			</p:dataTable>			
	
</h:form>			
		
		
	<ui:include src="dialogNuevoNivelParalelo.xhtml" />	
			
		
	</ui:define>
</ui:composition>